import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      component: () => import("@/views/login/index.vue"),
    },
    {
      path: "/register",
      component: () => import("@/views/register/index.vue"),
    },
    {
      path: "/tlayout",
      component: () => import("@/views/teacher-layout/index.vue"),
      children: [
        {
          path: "approval",
          component: () => import("@/views/teacher/approval.vue"),
        },
        {
          path: "state",
          component: () => import("@/views/teacher/state.vue"),
        },
        {
          path: "userInfo",
          component: () => import("@/views/teacher/userinfo.vue"),
        },
      ],
    },
    {
      path: "/slayout",
      component: () => import("@/views/stu-layout/index.vue"),
      children: [
        {
          path: "leave",
          component: () => import("@/views/sutdent/leave.vue"),
        },
        {
          path: "stuuserinfo",
          component: () => import("@/views/sutdent/userInfo.vue"),
        },
      ],
    },
  ],
});

export default router;
